how to solve a boundary value problem